import Vue from "vue";
import VueRouter from "vue-router";
import HomeView from "../views/HomeView.vue";
Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    name: "home",
    component: HomeView,
  },
  {
    path: "/login",
    name: "login",
    meta: { title: "企业管理" },
    component: () => import("../views/login.vue"),
  },
  {
    path: "/company",
    name: "company",
    meta: { title: "企业管理" },
    component: () => import("../views/company.vue"),
  },

  {
    path: "/dz",
    name: "dz",
    redirect: "/about",
    component: () => import("../views/layout.vue"),
    children: [
      {
        path: "/about",
        name: "about",
        meta: { title: "收据报销查重" },
        component: () => import("../views/AboutView.vue"),
      },
      {
        path: "/user",
        name: "user",
        meta: { title: "报销人管理" },
        component: () => import("../views/user.vue"),
      },
      {
        path: "/log",
        name: "log",
        meta: { title: "报销记录" },
        component: () => import("../views/log.vue"),
      },
      {
        path: "/file",
        name: "file",
        meta: { title: "发票电子归档" },
        component: () => import("../views/file.vue"),
      },
      {
        path: "/infp",
        name: "infp",
        meta: { title: "收票排版打印" },
        component: () => import("../views/infp.vue"),
      },
      {
        path: "/outfp",
        name: "outfp",
        meta: { title: "出票排版打印" },
        component: () => import("../views/outfp.vue"),
      },
      {
        path: "/type",
        name: "type",
        meta: { title: "报销类型" },
        component: () => import("../views/type.vue"),
      },
      {
        path: "/pdf",
        name: "pdf",
        meta: { title: "pdf" },
        component: () => import("../views/pdf.vue"),
      },
    ],
  },
];

const router = new VueRouter({
  mode: "history",
  base: process.env.BASE_URL,
  routes,
});

export default router;
